//
//  BaseAlert.h
//  PostDelivery
//
//  Created by wmz on 2020/6/22.
//  Copyright © 2020 wmz. All rights reserved.
//
#import <Foundation/Foundation.h>

//普通弹窗
#define PostAlert(str) [BaseAlert alertTitle:str];
//自动消失弹窗
#define PostAutoAlert(str) [BaseAlert alertTitle:str autoHideDurtion:1.5 tag:11111];

//信息提示
#define PostInfo(str) [BaseAlert showHudInfo:str inView:[BaseAlert getCurrentVC].view];
#define PostInfoView(str,view) [BaseAlert showHudInfo:str inView:view];

#define PostSuccess(str) [BaseAlert showHudSuccess:str inView:[BaseAlert getCurrentVC].view];
#define PostSuccessView(str,view) [BaseAlert showHudSuccess:str inView:view];

#define PostError(str) [BaseAlert showHudError:str inView:[BaseAlert getCurrentVC].view];
#define PostErrorView(str,view) [BaseAlert showHudError:str inView:view];

#define PostHudShow(str,view) [BaseAlert showHudWithText:str inView:view];
#define PostHudHide(view) [BaseAlert hideHudInView:view];

NS_ASSUME_NONNULL_BEGIN

//弹窗类
@interface BaseAlert : NSObject

+ (void)alertTitle:(nullable NSString*)message;
+ (void)alertTitle:(nullable NSString*)message tag:(NSInteger)tag;
+ (void)alertTitle:(nullable NSString*)message confirm:(nullable NSString*)confirm;
+ (void)alertTitle:(nullable NSString*)message block:(nullable AlertBlock)block;
+ (void)alertTitle:(nullable NSString*)message confirm:(nullable NSString*)confirm block:(nullable AlertBlock)block;
+ (void)alertTitle:(nullable NSString*)message cancel:(nullable NSString*)cancel block:(nullable AlertBlock)block;
+ (void)alertTitle:(nullable NSString*)message message:(nullable NSString*)message confirm:(nullable NSString*)confirm cancel:(nullable NSString*)cancel listArr:(nullable NSArray*)arr block:(nullable AlertBlock)block;
+ (void)alertTitle:(nullable NSString*)message message:(nullable NSString*)message confirm:(nullable NSString*)confirm cancel:(nullable NSString*)cancel listArr:(nullable NSArray*)arr style:(DialogType)style block:(nullable AlertBlock)block tag:(NSInteger)tag;

/// 封装一个简单的加载框 show
+ (void)showHudWithText:(nullable NSString*)text inView:(nullable UIView*)view;
/// 封装一个简单的加载框 miss
+ (void)hideHudInView:(nullable UIView*)view;

//自动消失
+ (void)alertTitle:(nullable NSString*)message autoHideDurtion:(NSTimeInterval)durtion tag:(NSInteger)tag;

/// 提示框
+ (void)showHudSuccess:(nullable NSString*)text inView:(nullable UIView*)view;
+ (void)showHudInfo:(nullable NSString*)text inView:(nullable UIView*)view;
+ (void)showHudError:(nullable NSString*)text inView:(nullable UIView*)view;
+ (void)showHudWithText:(nullable NSString*)text inView:(nullable UIView*)view style:(LoadingStyle)style;
/// 通用选择框
+ (void)showSelectTitle:(nullable NSString*)title dataSource:(NSArray*)dataSource block:(nullable PostSelectResult)block;
+ (void)showSelectTitle:(nullable NSString*)title
           defaultValue:(nullable NSString*)value
             dataSource:(NSArray*)dataSource
                  block:(nullable PostSelectResult)block;
//获取当前VC
+ (UIViewController *)getCurrentVC;
@end

NS_ASSUME_NONNULL_END
